const app = getApp();
Page({
  data:{
    bankName :'',
    cardNumber :'',
    identityCard :'',
    name :'',
  },
  toMore:function(){
    wx.navigateTo({
      url: '../../changecard/changecard',
    })
  },
  onShow: function () {
    // 银行卡信息
    const _this = this;
    wx.request({
      url: app.globalData.path + 'services/app/applets/BankMessageDetail',
      data: {},
      method: 'POST',
      header: {
        'content-type': 'application/json', // 默认值
        'Authorization': 'Bearer ' + app.globalData.authorization
      },
      success: function (res) {
        console.log(res.data);
        if(res.data.success){
          _this.setData({
            name: res.data.result.name,
            bankName: res.data.result.bankName,
            cardNumber: res.data.result.cardNumber,
            identityCard: res.data.result.identityCard,
            bankCode: res.data.result.bankCode
          })
        } else {
          wx.showToast({
            title: res.data.error.message,
            icon: 'none',
            duration: 2000
          })
        }
      }
    })
    wx.removeStorage({
      key: 'changecard',
      success: function (res) {
        console.log(res.data)
      }
    })
  }
})